<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <p>i = 10; j = 10; i+j=?</p>
    <p id="sumid"></p>
    <button onclick="mysum()">结果</button>
    <script>
        function mysum() {    //方法的定义用function
            var i = 10;
            var j = 10;
            var m = i+j;
            var n = i+=j;  //i=i+j;
            document.getElementById("sumid").innerHTML=m;
        }

    </script>

</body>
</html>